<?php





function generate_female_name() {
            $ci =& get_instance();
            
            $query = $ci->doctrine->em->createQuery("select max(u.id) from ORM\Dynasties2\Femalenames u");
            $result = $query->getSingleResult();
            //echo $result2[1];
            $highval = $result[1];
            $random_name = rand(1,$highval);
            //echo $random_name;
            $name = $ci->doctrine->em->find('ORM\Dynasties2\Femalenames', $random_name);
            return $name->getName();
                    
        }
function generate_male_name() {
        $ci =& get_instance();
        
        //$query = $this->doctrine->em->createQuery("select max(u.id) from ORM\Dynasties2\Malenames u");
        $query = $ci->doctrine->em->createQuery("select max(u.id) from ORM\Dynasties2\Malenames u");
             $result = $query->getSingleResult();
             //echo $result2[1];
             $highval = $result[1];
             $random_name = rand(1,$highval);
             //echo $random_name;
          //$name = $this->doctrine->em->find('ORM\Dynasties2\Malenames', $random_name);
          $name = $ci->doctrine->em->find('ORM\Dynasties2\Malenames', $random_name);
             return $name->getName();
            
            
        }



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
